<template>
  <div>
    <div class="outshop_body" v-for="inshop in inshopdata" :key="inshop.inid">
      <el-descriptions :column="3" border>
        <el-descriptions-item >
              <template slot="label" >
                <i class="el-icon-user-solid"></i>
                  入库人姓名
              </template>
                {{inshop.inusname}}
        </el-descriptions-item>
        <el-descriptions-item>
              <template slot="label">
                <i class="el-icon-postcard"></i>
                  身份证号
              </template>
                {{inshop.inidcard}}
        </el-descriptions-item>
        <el-descriptions-item>
              <template slot="label">
                <i class="el-icon-time"></i>
                  入库时间
              </template>
                {{inshop.inaddtime|dateFormat}}
        </el-descriptions-item>
        <el-descriptions-item>
              <template slot="label">
                <i class="el-icon-sell"></i>
                  入库商品
              </template>
                {{inshop.shop.shopname}}
        </el-descriptions-item>
        <el-descriptions-item>
              <template slot="label">
                <i class="el-icon-coin"></i>
                  入库数量
              </template>
                {{inshop.innum}}
        </el-descriptions-item>
        <el-descriptions-item>
              <template slot="label">
                <i class="el-icon-user"></i>
                  操作人
              </template>
                {{inshop.user.usname}}
        </el-descriptions-item>
      </el-descriptions>
      <br>

    </div>
  </div>
</template>

<script>
  export default {
    props: {
    	//子组件中设置一个必传参数,父组中通过属性操作v-bind传过来
    	inshopdata: {
    		type: Array,
    		required: true
    	}
    },
    filters:{
      dateFormat(value){
         let sDate = value.substr(0,10);
             let sTime = value.substr(11,8);
             value = sDate + " " + sTime;
             return value;
        }
    }
  }
</script>

<style>
 .el-descriptions-item__cell{
   width: 16%;
 }
</style>
